import type { InjectionKey } from "vue";
import type { CheckboxGroupProps, CheckboxProps } from "../config";

export interface CheckboxGroupContext {
	props: Required<CheckboxGroupProps>;
	addField: (field: CheckboxContext) => void;
	removeField: (field: CheckboxContext) => void;
	unCheckedOther(): void;
}

export interface CheckboxContext {
	props: Required<CheckboxProps>;
	isChecked: boolean | undefined;
	init(): void;
}

export const checkboxContextKey: InjectionKey<CheckboxContext> = Symbol(
	"ECheckboxContextKey"
);
export const checkboxGroupContextKey: InjectionKey<CheckboxGroupContext> =
	Symbol("ECheckboxGroupContextKey");
